﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BGM_ProjectNew.aspx.cs" Inherits="KPIS.GERP.GBMS.APP_UI.Form.BGM_ProjectNew" %>
<%@ Register src="../UserControls/DatePicker.ascx" tagname="DatePicker" tagprefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title><asp:Literal runat="Server" id="litTitle"/></title>
    <meta http-equiv="X-UA-Compatible" content="IE=9" />
    <script type="text/javascript" src="../../Scripts/Common.js"></script>
    <script type="text/javascript" src="../../Scripts/DatePicker.js"></script>
    <link rel="Stylesheet" href="../../Styles/StyleSheet.css" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
            
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="100">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel2" runat="server">
    </telerik:RadAjaxLoadingPanel>

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlView" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                    <telerik:AjaxUpdatedControl ControlID="pnlHeader" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="pnlInfo" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="pnlHeader">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlView" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                    <telerik:AjaxUpdatedControl ControlID="pnlHeader" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="pnlInfo" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="pnlView">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlView" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                    <telerik:AjaxUpdatedControl ControlID="pnlHeader" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="pnlInfo" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="pnlInfo">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="pnlView" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                    <telerik:AjaxUpdatedControl ControlID="pnlHeader" 
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="pnlInfo" 
                        LoadingPanelID="RadAjaxLoadingPanel2" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">

            var mode = 0;
            var approve = 0;
            function execPositionsTrue() {
                approve = 1;
            }
            function conFirmDel(str) {
                if (mode == 1) {
                    return confirm(str);
                }
            }
            function conFirmApr(str) {
                if (mode == 1 && approve == 1) {
                    return confirm(str);
                }
            }

            function openProjectExpenseDetails(id, status) {
                if (mode == 1) {
                    var type = document.getElementById("<%= lblType.ClientID %>").value;
                    radopen("BGM_Project_Expense.aspx?source=" + id + "&type=" + type + "&status=" + status, "Source");
                    return false;
                }
            }

            function openProjectOptionDetails(id) {
                if (mode == 1) {
                    var type = document.getElementById("<%= lblType.ClientID %>").value;
                    radopen("BGM_Project_Option.aspx?optType=" + id + "&type=" + type, "Option");
                    return false;
                }
            }

            function openProjectExpensePlanDetails(status) {
                if (mode == 1) {
                    var type = document.getElementById("<%= lblType.ClientID %>").value;
                    radopen("BGM_Project_Expense_Plan.aspx?type=" + type + "&status=" + status, "ProjectDtls");
                    return false;
                }
            }

            function openProjectWorkPlanDetails(status) {
                if (mode == 1) {
                    var type = document.getElementById("<%= lblType.ClientID %>").value;
                    radopen("BGM_Project_work_Plan.aspx?type=" + type + "&status=" + status, "ProjectDtls");
                    return false;
                }
            }

            function openProjectManagerDetails() {
                if (mode == 1) {
                    var type = document.getElementById("<%= lblType.ClientID %>").value;
                    radopen("BGM_Project_Manager.aspx?type=" + type, "Manager");
                    return false;
                }
            }

            function openProjectKPISDetails() {
                if (mode == 1) {
                    var type = document.getElementById("<%= lblType.ClientID %>").value;
                    radopen("BGM_Project_KPI.aspx?type=" + type + "&status=" + status, "ProjectDtls");
                    return false;
                }
            }

            function openProjectAssignDetails() {
                if (mode == 1) {
                    var type = document.getElementById("<%= lblType.ClientID %>").value;

                    radopen("BGM_Project_ReaderDtls.aspx", "AssignJob");
                    return false;
                }
                return true;
            }

            function getParameterByName(name) {
                name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
                var regexS = "[\\?&]" + name + "=([^&#]*)";
                var regex = new RegExp(regexS);
                var results = regex.exec(window.location.search);
                if (results == null)
                    return "";
                else
                    return decodeURIComponent(results[1].replace(/\+/g, " "));
            }

            function openProjectPrintPreview() {

                radopen("BGM_Project_PrintPreview.aspx", "PrintPreview");
                return false;
            }

            function openSendMessage() {
                if (mode == 1) {
                    var type = document.getElementById("<%= lblType.ClientID %>").value;
                    radopen("BGM_Project_SendMessage.aspx?type=" + type + "&jobsiteid=" + '<%= Request["id"] %>', "Approve");
                    return false;
                }
            }

            function openJobSitePass() {
                if (mode == 1) {
                    var type = document.getElementById("<%= lblType.ClientID %>").value;
                    radopen("BGM_Project_Pass.aspx?type=" + type, "Pass");
                    return false;
                }
            }

            function closeRadWindow(sender, args) {
                $find('<%= RadAjaxManager1.ClientID %>').ajaxRequest('');
            }

            function closeRadWindowApprove(sender, args) {
                $find('<%= RadAjaxManager1.ClientID %>').ajaxRequest('Approve');
            }

            function closeRadWindowJobSitePass(sender, args) {
                $find('<%= RadAjaxManager1.ClientID %>').ajaxRequest('JobSitePass');
            }

            function closeRadWindowManager(sender, args) {
                $find('<%= RadAjaxManager1.ClientID %>').ajaxRequest('Manager');
            }

            function closeRadWindowSource(sender, args) {
                $find('<%= RadAjaxManager1.ClientID %>').ajaxRequest('Source');
            }

            function closeRadWindowOption(sender, args) {
                $find('<%= RadAjaxManager1.ClientID %>').ajaxRequest('Option');
            }

            function isNumberKey(event) {
                var charCode = (event.which) ? event.which : event.keyCode
                if (charCode > 31 && (charCode < 48 || charCode > 57)) {
                    return false;
                }
                return true;
            }

            function openReport(key) {
                radopen("../Report/Report.aspx?key=" + key + "&case=201", "ProjectDtls");
            }

            function openShowAllReport() {
                radopen("../../Reports/RPT_Exports.aspx", "Popup");
            }

            var cancelDropDownClosing = false;

            function onClickLink(i) {
                mode = i;
            }

            function onTextChange(sender) {
                if (sender.get_value() == "") {
                    sender.set_text("");
                }
            }

            function StopPropagation(e) {
                e.cancelBubble = true;
                if (e.stopPropagation) {
                    e.stopPropagation();
                }
            }

            function OnClientDropDownClosingHandler(sender, e) {
                e.set_cancel(cancelDropDownClosing);
            }

            function HideTooltipCurrent() {
                var tooltip = Telerik.Web.UI.RadToolTip.getCurrent();
                if (tooltip) tooltip.hide();
            }

        </script>
    </telerik:RadCodeBlock>

    <telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false"
        ReloadOnShow="true" runat="server" Skin="Metro" Modal="true" KeepInScreenBounds="true" Style="z-index: 7001">
        <Windows>
            <telerik:RadWindow ID="ProjectDtls" runat="server" Width="950px" Height="600px" Behaviors="Reload, Close" OnClientClose="closeRadWindow">
            </telerik:RadWindow>
            <telerik:RadWindow ID="Manager" runat="server" Width="950px" Height="600px" Behaviors="Reload, Close" OnClientClose="closeRadWindowManager">
            </telerik:RadWindow>
            <telerik:RadWindow ID="Source" runat="server" Width="950px" Height="600px" Behaviors="Reload, Close" OnClientClose="closeRadWindowSource">
            </telerik:RadWindow>
            <telerik:RadWindow ID="Option" runat="server" Width="950px" Height="600px" Behaviors="Reload, Close" OnClientClose="closeRadWindowOption">
            </telerik:RadWindow>
            <telerik:RadWindow ID="Approve" runat="server" Width="800px" Height="350px" Behaviors="Reload, Close, Move, Resize" OnClientClose="closeRadWindowApprove">
            </telerik:RadWindow>
            <telerik:RadWindow ID="PrintPreview" runat="server" Width="850px" Height="500px" Behaviors="Reload, Close">
            </telerik:RadWindow>
            <telerik:RadWindow ID="AssignJob" runat="server" Width="850px" Height="500px" Behaviors="Reload, Close">
            </telerik:RadWindow>
			<telerik:RadWindow ID="Pass" runat="server" Width="550px" Height="250px" Behaviors="Reload, Close" OnClientClose="closeRadWindowJobSitePass">
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>

    <div class="defaultFont" style="padding: 10px">
        <asp:Panel ID="pnlHeader" runat="server">
            <div class="header-grid">
                <table>
                    <tr>
                        <td>
                            <asp:LinkButton ID="btnAddNew" runat="server" OnClick="btnAddNew_Click" CssClass="ControlLinkButton">
                                <img height="16px" alt="" src="../Image/MetroIcon/add.png" />
                                &nbsp;เพิ่มโครงการใหม่
                            </asp:LinkButton>
                            <asp:LinkButton ID="btnEdit" runat="server" CssClass="ControlLinkButton"
                                OnClick="btnEdit_Click">
                                <img height="16px" alt="" src="../Image/MetroIcon/edit.png" />
                                &nbsp;แก้ไขข้อมูลโครงการ
                            </asp:LinkButton>
                            <asp:LinkButton ID="btnDelete" runat="server" CssClass="ControlLinkButton"
                                OnClientClick="javascript:return conFirmDel('ยืนยันการลบข้อมูลที่เลือก')" 
                                OnClick="Delete_Click">
                                <img height="16px" alt="" src="../Image/MetroIcon/delete.png" />
                                &nbsp;ยกเลิกโครงการ
                            </asp:LinkButton>
                            <asp:LinkButton ID="btnPrintPreview" runat="server" CssClass="ControlLinkButton"
                                OnClientClick="openProjectPrintPreview()" OnClick="btnPrintPreview_Click">
                                <img height="16px" alt="" src="../Image/MetroIcon/print.png" />
                                &nbsp;แสดงข้อมูลก่อนพิมพ์
                            </asp:LinkButton>
                            <asp:LinkButton ID="btnApprove" runat="server" CssClass="ControlLinkButton"
                                OnClientClick="openSendMessage()">
                                <img height="16px" alt="" src="../Image/MetroIcon/check.png" />
                                &nbsp;ส่งคำขอไป ผอ.
                            </asp:LinkButton>
                            <asp:LinkButton ID="btnSaveAddNew" runat="server" CssClass="ControlLinkButton"
                                OnClientClick="openSendMessage()"
                                OnClick="btnSaveAddNew_Click">
                                <img height="16px" alt="" src="../Image/MetroIcon/save.png" />
                                &nbsp;บันทึกรายการใหม่
                            </asp:LinkButton>
                            <asp:LinkButton ID="btnSaveEdit" runat="server" CssClass="ControlLinkButton"
                                OnClientClick="openSendMessage()"
                                OnClick="btnSaveEdit_Click">
                                <img height="16px" alt="" src="../Image/MetroIcon/save.png" />
                                &nbsp;บันทึกแก้ไขรายการ
                            </asp:LinkButton>
                            <asp:LinkButton ID="btnCancel" runat="server" CssClass="ControlLinkButton"
                                OnClientClick="openSendMessage()"
                                OnClick="btnCancel_Click">
                                <img height="16px" alt="" src="../Image/MetroIcon/cancel.png" />
                                &nbsp;ยกเลิกแก้ไข
                            </asp:LinkButton>
                            <asp:Label ID="lblApproved" runat="server" Text="" />
                        </td>
                    </tr>
                </table>
            </div>
        </asp:Panel>
        
        <asp:Panel ID="pnlView" runat="server">
            <br />
            <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="dtgProj" 
				runat="server" AutoGenerateColumns="false"
                AllowMultiRowEdit="false"
                AllowMultiRowSelection="false" 
                ShowStatusBar="false" AllowPaging="false" 
                AllowSorting="True" AllowFilteringByColumn="true"
                Width="100%" Height="500px"
                GroupingSettings-GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;"
                GroupingSettings-GroupContinuedFormatString=""
                GroupingSettings-GroupContinuesFormatString=""
                GroupingSettings-GroupSplitFormat=""
                OnNeedDataSource="dtgProj_NeedDataSource"
                OnEditCommand="dtgProj_EditCommand">
                <MasterTableView AllowMultiColumnSorting="True" CellSpacing="-1" Width="100%"
                    DataKeyNames="Sequence" NoMasterRecordsText="< ไม่มีข้อมูล >">
                    <RowIndicatorColumn>
                        <HeaderStyle Width="20px" />
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn>
                        <HeaderStyle Width="20px" />
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridBoundColumn DataField="Sequence"
                            UniqueName="Sequence" Visible="False">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="record_status" 
                            UniqueName="record_status" Visible="False">
                        </telerik:GridBoundColumn>

                        <telerik:GridTemplateColumn AllowFiltering="false">
                            <FilterTemplate></FilterTemplate>
                            <ItemTemplate>
                                <asp:ImageButton ID="cmdEdit" runat="server" CommandName="Edit"
                                    ImageUrl="~/App_UI/Image/Buttons/Magnifier.gif" ToolTip="แสดงรายละเอียด" />
                            </ItemTemplate>
                            <HeaderStyle Width="28px" />
                            <ItemStyle HorizontalAlign="Center" />
                        </telerik:GridTemplateColumn>

                        <telerik:GridBoundColumn DataField="bgm_prj_code" HeaderText="รหัสรายการ"
                            UniqueName="bgm_prj_code" AutoPostBackOnFilter="true" Visible="False"
                            CurrentFilterFunction="Contains" ShowFilterIcon="False"> 
                        </telerik:GridBoundColumn>

                        <telerik:GridBoundColumn DataField="bgm_prj_name" HeaderText="ชื่อโครงการ"
                            UniqueName="bgm_prj_name" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                            CurrentFilterFunction="Contains" ShowFilterIcon="False"> 
                            <HeaderStyle HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Left"/>
                        </telerik:GridBoundColumn>

                        <telerik:GridBoundColumn DataField="date_start" HeaderText="วันที่เริ่มต้น"
                            UniqueName="date_start" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                            CurrentFilterFunction="Contains" ShowFilterIcon="False" DataFormatString="{0:d}">
                            <HeaderStyle Width="120px" HorizontalAlign="Center" />
                            <ItemStyle HorizontalAlign="Center"/>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="date_end" HeaderText="วันที่สิ้นสุด"
                            UniqueName="date_end" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                            CurrentFilterFunction="Contains" ShowFilterIcon="False" DataFormatString="{0:d}">
                            <HeaderStyle Width="120px"  HorizontalAlign="Center"/>
                            <ItemStyle HorizontalAlign="Center"/>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="total_amount" HeaderText="วงเงินรวม(บาท)"
                            UniqueName="total_amount" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                            CurrentFilterFunction="Contains" ShowFilterIcon="False" DataFormatString="{0:n2}">
                            <HeaderStyle Width="120px"  HorizontalAlign="Center"/>
                            <ItemStyle HorizontalAlign="Center"/>
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="record_status_name" HeaderText="สถานะรายการ"
                            UniqueName="record_status_name" AutoPostBackOnFilter="true" FilterControlWidth="100%"
                            CurrentFilterFunction="Contains" ShowFilterIcon="False">
                            <HeaderStyle Width="120px"  HorizontalAlign="Center"/>
                            <ItemStyle HorizontalAlign="Center"/>
                        </telerik:GridBoundColumn>
                    </Columns>
                    <PagerStyle Mode="NumericPages" AlwaysVisible="true" 
                        FirstPageToolTip="กลับหน้าแรก" LastPageToolTip="ไปหน้าสุดท้าย" 
                        NextPagesToolTip="หน้าถัดไป" NextPageToolTip="หน้าถัดไป" 
                        PrevPagesToolTip="ย้อนกลับ" PrevPageToolTip="ย้อนกลับ" />
                </MasterTableView>
                <GroupingSettings GroupByFieldsSeparator="&nbsp;&nbsp;&nbsp;&nbsp;" 
                    GroupContinuedFormatString="" GroupContinuesFormatString="" 
                    GroupSplitFormat="" />
                <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="false">
                    <Selecting AllowRowSelect="false" />
                    <Scrolling AllowScroll="true" UseStaticHeaders="true" />
                </ClientSettings>
            </telerik:RadGrid>
        </asp:Panel>

        <asp:Panel ID="pnlInfo" runat="server">
            <br />
            <asp:Label ID="lblType" runat="server" Visible="false"></asp:Label> 
            <asp:Label ID="lblProjectSeq" runat="server" Visible="false"></asp:Label>      
            <asp:Label ID="lblJobSiteSeq" runat="server" Visible="false"></asp:Label>   
            <asp:Label ID="lblExecPosSeq" runat="server" Visible="false"></asp:Label>
            <asp:Panel id="PanelReplyRemarks" runat="server" Visible="false">
                <div class="DivInfo">
                    <asp:Label ID="lblReplyRemark" runat="server" ForeColor="Red" />
                </div>
            </asp:Panel>
            <table cellpadding="0" cellspacing="0">
                <tr>
                    <td width="500px" valign="top">
                        <table cellpadding="0" cellspacing="0" class="defaultTable">
                            <tr>
                                <td width="130px" align="left" style="border-bottom-width: 1px; border-bottom-color: #CCCCCC; border-bottom-style: groove; padding-left: 5px; padding-bottom: 2px; padding-top: 20px;">
                                    ปีงบประมาณ :
                                </td>
                                <td align="left" style="border-bottom-width: 1px; border-bottom-color: #CCCCCC; border-bottom-style: groove; padding-bottom: 2px; padding-top: 20px;">
                                    <asp:Label ID="lbBgmYear" runat="server" Text="-"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td align="left" class="defaultTableLineLeftColumn">
                                    วันที่บันทึก :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjDate" runat="server" Text="-"></asp:Label>
                                    <asp:TextBox CssClass="defaultTextbox" ID="txtProjDate" runat="server" Width="30%" Visible="false"></asp:TextBox>  
                                </td>
                            </tr>
                            <tr>
                                <td align="left" class="defaultTableLineLeftColumn">
                                    ชื่อโครงการ :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbPrefix" runat="server" Text="โครงการ " Visible="false" />
                                    <asp:Label ID="lbProjName" runat="server" Text="-"></asp:Label>
                                    <asp:TextBox CssClass="defaultTextbox" ID="txtProjName" runat="server" Width="65%" Visible="false" AutoCompleteType="Disabled"></asp:TextBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtProjName"
                                        ErrorMessage="กรอกข้อมูล" ValidationGroup="1" SetFocusOnError="true">
                                    </asp:RequiredFieldValidator>                                                    
                                </td>
                            </tr>
                            <tr>
                                <td align="left" class="defaultTableLineLeftColumn">
                                    กิจกรรมย่อย :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjStrat" runat="server" Text="-"></asp:Label>
                                    <telerik:RadComboBox ID="ddlStrategy" runat="server" Visible="false"
                                        AllowCustomText="true" CausesValidation="false" DataTextField="text" 
                                        DataValueField="value" EmptyMessage="---- พิมพ์ที่นี่เพื่อค้นหากิจกรรมย่อย ----"
                                        Filter="Contains" OnClientTextChange="onTextChange" Width="80%">
                                    </telerik:RadComboBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="ddlStrategy" ErrorMessage="กรอกข้อมูล" ValidationGroup="1" SetFocusOnError="true"></asp:RequiredFieldValidator>                                                    
                                </td>
                            </tr>
                            <tr>
                                <td align="left" class="defaultTableLineLeftColumn">
                                    หน่วยงานหลัก :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjJobSiteMain" runat="server" Text="-" />
                                    <telerik:RadComboBox ID="ddlJobSite" runat="server" Visible="false"
                                        AllowCustomText="true" CausesValidation="false" DataTextField="text" 
                                        DataValueField="value" EmptyMessage="---- พิมพ์ที่นี่เพื่อค้นหาหน่วยงาน ----" 
                                        Filter="Contains" OnClientTextChange="onTextChange" Width="80%" 
                                        Enabled="true" AutoPostBack="True" />
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                        ControlToValidate="ddlJobSite" ErrorMessage="กรอกข้อมูล" 
                                        ValidationGroup="1" SetFocusOnError="true" />
                                </td>
                            </tr>
                            <tr>
                                <td align="left" class="defaultTableLineLeftColumn" width="130px">
                                    หน่วยงานรอง :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjJobSite" runat="server" Text="-" />
                                    <asp:Label ID="lbProjJobSiteSeq" runat="server" Visible="false" />
                                </td>
                            </tr>
                            <tr>
                                <td align="left" class="defaultTableLineLeftColumn">
                                    หัวหน้าสำนัก:
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lblJobSiteHeadPos" runat="server" Text="" />
                                    <asp:Label ID="lblJobSiteHeadPosLoadError" runat="server" Text="" ForeColor="Red" />
                                </td>
                            </tr>
                            <tr>
                                <td align="left" class="defaultTableLineLeftColumn" valign="top">
                                    หน่วยงานเพื่อทราบ :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn" valign="top">
                                    <asp:Repeater ID="repeaterJobSitePass" runat="server" 
                                        OnItemCommand="repeaterJobSitePass_ItemCommand">
                                        <ItemTemplate>
                                            <table>
                                                <tr>
                                                    <td>
                                                        <asp:ImageButton ID="cmdDelete" runat="server" CommandName="Delete"
                                                            ImageUrl="~/App_UI/Image/Grid/Delete.gif"
                                                            OnClientClick="javascript:return conFirmDel('ยืนยันการลบข้อมูลที่เลือก')" 
                                                            ToolTip="ลบรายการ" />
                                                    </td>
                                                    <td>
                                                        <asp:Label ID="lblBgmReqPassSeq" runat="server" Visible="false" Text='<%# Eval("bgm_req_pass_seq") %>' />
                                                            <%# Eval("job_site_name") %>
                                                    </td>
                                                </tr>
                                            </table>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                    <asp:LinkButton ID="btnJobSitePass" runat="server" CssClass="LinkButton" OnClientClick="openJobSitePass()"><img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/table.gif" />&nbsp;&nbsp;&nbsp;เพิ่มหน่วยงานเพื่อทราบ</asp:LinkButton>
                                </td>
                            </tr>
                        </table>
                        <br />
                    </td>
                    <td valign="top">
                        <table width="100%" style="font-family: 'Segoe UI'; font-size: 13px;">
                            <tr valign="top">
                                <td align="right" style="padding-top: 10px; padding-left: 20px;">
                                    <asp:Label ID="lbGridSource" runat="server" CssClass="defaultFont" Text="<<< คลิ๊กที่ชื่อแหล่งเงินเพื่อบันทึกรายงาน 202 >>>" ForeColor="#999999" Visible="false" />
                                </td>
                            </tr>
                            <tr valign="top">
                                <td align="right" style="padding-left: 20px; padding-top: 10px;">
                                    <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="gridSource" runat="server" 
                                        AutoGenerateColumns="False" 
                                        GridLines="None" MasterTableView-GridLines="None" 
                                        Width="100%">
                                        <mastertableview ShowFooter="true" NoMasterRecordsText="... ไม่มีข้อมูล ..." CommandItemDisplay="none" datakeynames="bgm_source_seq" width="100%">                                                           
                                        <Columns>
                                            <telerik:GridTemplateColumn AllowFiltering="false" Visible="false">
                                                <HeaderStyle Width="20px"></HeaderStyle>
                                                <ItemStyle Height="20px"></ItemStyle>
                                                <ItemTemplate>
                                                    <asp:ImageButton ID="addControl" BorderWidth="0px" ImageUrl="../Image/Grid/Magnifier.gif"
                                                        OnClientClick='<%# string.Format("return openProjectExpenseDetails(\"{0}\",\"{1}\");"
                                                            , Eval("bgm_source_seq"), Eval("total_amount")) %>'
                                                        AlternateText="รายละเอียด" Style="float: right; cursor: pointer;" runat="server">
                                                    </asp:ImageButton>
                                                </ItemTemplate>
                                                                            
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridTemplateColumn Visible="false">
                                                <ItemTemplate>
                                                    <asp:Label ID="Sequence" runat="server" Text='<%# Eval("bgm_source_seq") %>'></asp:Label>
                                                </ItemTemplate>
                                                <HeaderStyle HorizontalAlign="Center" />
                                            </telerik:GridTemplateColumn>
                                            <telerik:GridBoundColumn DataField="bgm_source_name"
                                                FilterControlWidth="100%" HeaderStyle-HorizontalAlign="Center" 
                                                HeaderText="แหล่งเงิน" ItemStyle-HorizontalAlign="Left" 
                                                FooterText="รวมทั้งหมด :"
                                                UniqueName="bgm_source_name" >
                                                <HeaderStyle HorizontalAlign="Center" />
                                                <FooterStyle Font-Bold="true" HorizontalAlign="Center" /> 
                                                <ItemStyle HorizontalAlign="Left" />
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn DataField="total_amount"
                                                Aggregate="Sum"
                                                FooterAggregateFormatString="{0:#,##0}"
                                                DataFormatString="{0:#,##0}"
                                                HeaderStyle-HorizontalAlign="Center"
                                                HeaderText="วงเงินขอ(บาท)" 
                                                UniqueName="total_amount" Visible="true">
                                                <HeaderStyle HorizontalAlign="Center" Width="100px" />
                                                <FooterStyle Font-Bold="true" HorizontalAlign="Right" />
                                                <ItemStyle HorizontalAlign="Right" />
                                            </telerik:GridBoundColumn>

                                            <telerik:GridBoundColumn DataField="approve_amount"
                                                Aggregate="Sum"
                                                FooterAggregateFormatString="{0:#,##0}"
                                                DataFormatString="{0:#,##0}"
                                                HeaderStyle-HorizontalAlign="Center"
                                                HeaderText="อนุมัติ(บาท)" 
                                                UniqueName="approve_amount" Visible="false">
                                                <HeaderStyle HorizontalAlign="Center" Width="80px" />
                                                <FooterStyle Font-Bold="true" HorizontalAlign="Right" />
                                                <ItemStyle HorizontalAlign="Right" />
                                            </telerik:GridBoundColumn>
                                                                        
                                        </Columns>
                                        </mastertableview>
                                    <clientsettings>
                                        <clientevents /><selecting allowrowselect="True" /></clientsettings>
                                </telerik:RadGrid>
                                </td>
                            </tr>
                            <tr>
                                <td align="right" style="padding-top: 10px; padding-left: 50px;">
                                    &nbsp;&nbsp;&nbsp;
                                    <asp:LinkButton ID="btnExpPlan" runat="server" CssClass="LinkButton" OnClientClick="openProjectExpensePlanDetails()"><img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/table.gif" />&nbsp;&nbsp;&nbsp;แสดงแผนการใช้จ่ายงบประมาณ</asp:LinkButton>
                                    <asp:Label ID="lbExpPlanEmpty" runat="server" ForeColor="Red" Text="ยังไม่มีข้อมูล" Visible="false" />
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            <table cellpadding="0" cellspacing="0" style="width: 100%; font-family: 'Segoe UI'; font-size: 13px;">
                <tr valign="top">
                    <td width="45%" >
                        <table width="100%" style="font-family: 'Segoe UI'; font-size: 13px;">
                            <tr valign="top">
                                <td align="left" style="padding-top: 5px;">
                                    <asp:LinkButton ID="btnManager" runat="server" CssClass="LinkButton" OnClientClick="openProjectManagerDetails();"><img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/table.gif" />&nbsp;&nbsp;&nbsp;ระบุรายชื่อผู้รับผิดชอบโครงการ</asp:LinkButton>
                                </td>
                            </tr>
                            <tr valign="top">
                                <td style="padding-top: 15px;">
                                    <telerik:RadGrid GroupingSettings-CaseSensitive="false" ID="gridManager" runat="server" 
                                        AutoGenerateColumns="False"
                                        GridLines="None" MasterTableView-GridLines="None" 
                                        Width="100%">
                                        <mastertableview NoMasterRecordsText="... ไม่มีข้อมูล ..." commanditemdisplay="none" datakeynames="bgm_proj_mng_seq" width="100%">                                                           
                                        <Columns>
                                            <telerik:GridTemplateColumn Visible="false">
                                                <ItemTemplate>
                                                    <asp:Label ID="lbManagerSeq" runat="server" Text='<%# Eval("bgm_proj_mng_seq") %>'></asp:Label>
                                                </ItemTemplate>
                                                <HeaderStyle HorizontalAlign="Center" />
                                            </telerik:GridTemplateColumn> 
                                            <telerik:GridTemplateColumn HeaderStyle-Width="50%" 
                                                HeaderStyle-HorizontalAlign="Center" HeaderText="ผู้รับผิดชอบโครงการ" ItemStyle-HorizontalAlign="Left"> 
                                                <ItemTemplate>
                                                    <asp:Label ID="full_name" runat="server" NavigateUrl="#" Text='<%# Eval("name") %>'></asp:Label>
                                                </ItemTemplate>
                                                <HeaderStyle HorizontalAlign="Center" />
                                            </telerik:GridTemplateColumn> 
                                                                        
                                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                                CurrentFilterFunction="Contains" 
                                                DataField="pos_name" 
                                                FilterControlWidth="100%" 
                                                HeaderText="ตำแหน่ง" 
                                                ShowFilterIcon="false" 
                                                UniqueName="pos_name" Visible="true">
                                                <HeaderStyle HorizontalAlign="Center" Width="200px"/>
                                                <ItemStyle HorizontalAlign="Left" />
                                            </telerik:GridBoundColumn>
                                                                        
                                            <telerik:GridBoundColumn AutoPostBackOnFilter="true" 
                                                CurrentFilterFunction="Contains" 
                                                DataField="tel" 
                                                FilterControlWidth="100%" 
                                                HeaderText="โทร" 
                                                ShowFilterIcon="false" 
                                                UniqueName="tel" Visible="true">
                                                <HeaderStyle HorizontalAlign="Center" Width="100px"/>
                                                <ItemStyle HorizontalAlign="Left" />
                                            </telerik:GridBoundColumn>
                                                                        
                                        </Columns>
                                        </mastertableview>
                                    <clientsettings>
                                        <clientevents /><selecting />
                                    </clientsettings>
                                </telerik:RadGrid>
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td style="padding-left: 30px;">
                        <table cellpadding="0" cellspacing="0" class="defaultTable">
                            <tr>
                                <td align="left" width="120px" class="defaultTableLineLeftColumn"><%--style="border-bottom-width: 1px; border-bottom-color: #CCCCCC; border-bottom-style: groove; padding-left: 5px; padding-bottom: 2px; padding-top: 30px;"--%>
                                    วันที่เริ่มต้น :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn"><%--style="border-bottom-width: 1px; border-bottom-color: #CCCCCC; border-bottom-style: groove; padding-bottom: 2px; padding-top: 30px;"--%>
                                    <asp:Label ID="lblStartDate" runat="server" Text="-"></asp:Label>
                                    <uc1:DatePicker ID="txtStartDate" runat="server" />
                                    &nbsp;<label id="Label2" runat="server" visible="false"><font color="red">*</font></label>
                                </td>
                            </tr>
                            <tr>
                                <td align="left" width="120px" class="defaultTableLineLeftColumn">
                                    วันที่สิ้นสุด :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lblEndDate" runat="server" Text="-"></asp:Label>
                                    <uc1:DatePicker ID="txtEndDate" runat="server" />
                                    &nbsp;<label id="Label1" runat="server" visible="false"><font color="red">*</font></label>
                                </td>
                            </tr>
                            <tr>
                                <td align="left" width="120px" class="defaultTableLineLeftColumn">
                                    ประเภทโครงการ :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjType" runat="server" Text="-"></asp:Label>
                                    <telerik:RadComboBox ID="ddlProjType" runat="server" AllowCustomText="true" 
                                        CausesValidation="false" DataTextField="text" DataValueField="value" 
                                        EmptyMessage="... พิมพ์ที่นี่เพื่อค้นหาประเภทโครงการ ..." Filter="Contains" 
                                        OnClientTextChange="onTextChange" Width="270px" Visible="false"></telerik:RadComboBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
                                        ControlToValidate="ddlProjType" ErrorMessage="กรอกข้อมูล" ValidationGroup="1"
                                        SetFocusOnError="true"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="left" width="120px" class="defaultTableLineLeftColumn">
                                    พื้นที่ดำเนินการ :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjScope" runat="server" Text="-"></asp:Label>
                                    <telerik:RadComboBox ID="ddlProjScope" runat="server" AllowCustomText="true" 
                                        CausesValidation="false" DataTextField="text" DataValueField="value" 
                                        EmptyMessage="... พิมพ์ที่นี่เพื่อค้นหาพื้นที่ดำเนินการ ..." Filter="Contains" 
                                        OnClientTextChange="onTextChange" Width="270px" Visible="false"></telerik:RadComboBox>
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
                                        ControlToValidate="ddlProjScope" ErrorMessage="กรอกข้อมูล" ValidationGroup="1"
                                        SetFocusOnError="true"></asp:RequiredFieldValidator>
                                </td>
                            </tr>
                            <tr>
                                <td align="left" width="120px"  class="defaultTableLineLeftColumn">
                                    ระยะเวลาดำเนินการ :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:LinkButton ID="btnWorkPlan" runat="server" CssClass="LinkButton" OnClientClick="openProjectWorkPlanDetails()" ><<< <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/table.gif" />&nbsp;แสดงแผนการดำเนินงาน >>></asp:LinkButton>
                                    <asp:Label ID="lbWorkPlanEmpty" runat="server" ForeColor="Red" Text="ยังไม่มีข้อมูล" Visible="false" />
                                </td>
                            </tr>
                            <tr>
                                <td align="left" width="120px"  class="defaultTableLineLeftColumn">
                                    ตัวชี้วัดความสำเร็จ :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:LinkButton ID="btnKPI" runat="server" CssClass="LinkButton" OnClientClick="openProjectKPISDetails()" ><<< <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/table.gif" />&nbsp;แสดงตัวชี้วัดความสำเร็จ >>></asp:LinkButton>
                                    <asp:Label ID="lbKPIEmpty" runat="server" ForeColor="Red" Text="ยังไม่มีข้อมูล" Visible="false" />
                                </td>
							</tr>
                        </table>
                        <asp:Panel ID="pnlAssignProjectPopup" runat="server">
                            <table cellpadding="0" cellspacing="0" class="defaultTable">
							    <tr>
								    <td align="left" width="120px" class="defaultTableLineLeftColumn">
									    มอบหมายงาน
								    </td>
								    <td align="left" class="defaultTableLineRightColumn">
                                        <asp:LinkButton ID="lkbAssignProjectPopup" runat="server" CssClass="LinkButton" OnClientClick="openProjectAssignDetails()" ><<< <img style="border:0px;vertical-align:middle;" alt="" src="../Image/Grid/table.gif" />&nbsp;แสดงการมอบหมายงานภายในโครงการ >>></asp:LinkButton>
                                        <asp:Label ID="lblAssignNoData" runat="server" ForeColor="Red" Text="ยังไม่มีข้อมูล" Visible="false" />
                                    </td>
                                </tr>
                            </table>
                        </asp:Panel>
                    </td>
                </tr>
            </table>
            <table cellpadding="0" cellspacing="0" class="defaultTable">
                <tr>
                    <td width="55%" valign="top" style="padding-top: 20px">
                        <table cellpadding="0" cellspacing="0" class="defaultTable">
                            <tr>
                                <td align="left" width="25%" 
                                    style="border-bottom-width: 1px; border-bottom-color: #CCCCCC; border-bottom-style: groove; padding-left: 5px; padding-bottom: 2px; padding-top: 12px;" 
                                    valign="top">
                                    หลักการและเหตุผล :
                                </td>
                                <td align="left" style="border-bottom-width: 1px; border-bottom-color: #CCCCCC; border-bottom-style: groove; padding-bottom: 2px; padding-top: 12px;">
                                    <asp:Label ID="lbProjReason" runat="server" Text="-"></asp:Label>
                                    <asp:TextBox CssClass="defaultTextbox" ID="txtProjReason" runat="server" TextMode="MultiLine" Width="95%" height="80px" Visible="false"></asp:TextBox>  
                                </td>
                            </tr>
                            <tr>
                                <td align="left" class="defaultTableLineLeftColumn" valign="top">
                                    วัตถุประสงค์ :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjObject" runat="server" Text="-"></asp:Label>
                                    <asp:TextBox CssClass="defaultTextbox" ID="txtProjObject" runat="server" TextMode="MultiLine" Width="95%" height="80px" Visible="false"></asp:TextBox>  
                                </td>
                            </tr>
                            <tr>
                                <td align="left" class="defaultTableLineLeftColumn" valign="top">
                                    เป้าหมายกิจกรรม :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjTarget" runat="server" Text="-"></asp:Label>
                                    <asp:TextBox CssClass="defaultTextbox" ID="txtProjTarget" runat="server" TextMode="MultiLine" Width="95%" height="80px" Visible="false"></asp:TextBox>  
                                </td>
                            </tr>
                            <tr>
                                <td align="left" class="defaultTableLineLeftColumn" valign="top">
                                    วิธีการดำเนินการ :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjPlan" runat="server" Text="-"></asp:Label>
                                    <asp:TextBox CssClass="defaultTextbox" ID="txtProjPlan" runat="server" TextMode="MultiLine" Width="95%" height="80px" Visible="false"></asp:TextBox>  
                                </td>
                            </tr>
                            <tr>
                                <td align="left" class="defaultTableLineLeftColumn" valign="top">
                                    หมายเหตุ :
                                </td>
                                <td align="left" class="defaultTableLineRightColumn">
                                    <asp:Label ID="lbProjRemark" runat="server" Text="-"></asp:Label>
                                    <asp:TextBox CssClass="defaultTextbox" ID="txtProjRemark" runat="server" TextMode="MultiLine" Width="95%" height="80px" Visible="false"></asp:TextBox>  
                                </td>
                            </tr>
                        </table>
                    </td>
                    <td valign="top" align="right">
                        <asp:Panel ID="PanelOption" runat="server" Visible="true">
                                                        
                        </asp:Panel>
                    </td>
                </tr>
            </table>
        </asp:Panel>
    </div>
    </form>
</body>
</html>
